#ifndef TCP_SOCKET_IO_H
#define TCP_SOCKET_IO_H

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <errno.h>

/* Funcoes de leitura e escrita em sockets TCP */

int read_int(int sockfd, int *n);
int read_string(int sockfd, char *str, int max);
int readn(int sockfd, void *buf, int n);

int write_int(int sockfd, int n);
int write_string(int sockfd, char *str, int max);
int writen(int sockfd, void *buf, int n);

#endif
